$OpenBSD: patch-CMakeLists_txt,v 1.2 2016/11/17 09:51:41 fcambus Exp $

Make PortAudio and CAPSImage detection conditional and disabled by default,
and disable building the Python GTK+2 user interface.

--- CMakeLists.txt.orig	Thu Nov  3 22:25:43 2016
+++ CMakeLists.txt	Sat Nov 12 17:20:14 2016
@@ -40,6 +40,12 @@ set(ENABLE_SMALL_MEM 0
     CACHE BOOL "Enable to use less memory - at the expense of emulation speed")
 set(ENABLE_WINUAE_CPU 1
     CACHE BOOL "Enable WinUAE CPU core")
+set(ENABLE_PORTAUDIO 0
+    CACHE BOOL "Enable building with PortAudio to enable microphone input in Falcon mode")
+set(ENABLE_CAPSIMAGE 0
+    CACHE BOOL "Enable building with CAPSImage for using .IPF, .RAW and .CTR disk images")
+set(ENABLE_UI 0
+    CACHE BOOL "Enable building the Python GTK+2 user interface, requires GTK+2 bindings")
 
 # Run-time checks with GCC "mudflap" etc features:
 # - stack protection
@@ -127,15 +133,19 @@ if (NOT ENABLE_OSX_BUNDLE)
 	endif(X11_FOUND)
 endif()
 
-find_package(PortAudio)
-if(PORTAUDIO_FOUND)
-	set(HAVE_PORTAUDIO 1)
-endif(PORTAUDIO_FOUND)
+if(ENABLE_PORTAUDIO)
+	find_package(PortAudio)
+	if(PORTAUDIO_FOUND)
+		set(HAVE_PORTAUDIO 1)
+	endif(PORTAUDIO_FOUND)
+endif(ENABLE_PORTAUDIO)
 
-find_package(CapsImage)
-if(CAPSIMAGE_FOUND)
-	set(HAVE_CAPSIMAGE 1)
-endif(CAPSIMAGE_FOUND)
+if(ENABLE_CAPSIMAGE)
+	find_package(CapsImage)
+	if(CAPSIMAGE_FOUND)
+		set(HAVE_CAPSIMAGE 1)
+	endif(CAPSIMAGE_FOUND)
+endif(ENABLE_CAPSIMAGE)
 
 find_package(Udev)
 if(UDEV_FOUND)
@@ -302,10 +312,12 @@ add_subdirectory(src)
 add_subdirectory(doc)
 add_subdirectory(tools)
 
-include(FindPythonInterp)
-if(PYTHONINTERP_FOUND)
-	add_subdirectory(python-ui)
-endif(PYTHONINTERP_FOUND)
+if(ENABLE_UI)
+	include(FindPythonInterp)
+	if(PYTHONINTERP_FOUND)
+		add_subdirectory(python-ui)
+	endif(PYTHONINTERP_FOUND)
+endif(ENABLE_UI)
 
 if(UNIX AND NOT ENABLE_OSX_BUNDLE)
 	add_subdirectory(share)
@@ -352,17 +364,20 @@ else()
   message( "  - png :\tnot found, install it to compress screenshot/avi files using png" )
 endif(PNG_FOUND)
 
-if(PORTAUDIO_FOUND)
-  message( "  - portaudio :\tfound, enables the microphone input in Falcon mode" )
-else()
-  message( "  - portaudio :\tnot found, install it to enable the Falcon microphone input" )
-endif(PORTAUDIO_FOUND)
+if(ENABLE_PORTAUDIO)
+  if(PORTAUDIO_FOUND)
+    message( "  - portaudio :\tfound, enables the microphone input in Falcon mode" )
+  else()
+    message( "  - portaudio :\tnot found, install it to enable the Falcon microphone input" )
+  endif(PORTAUDIO_FOUND)
+endif(ENABLE_PORTAUDIO)
 
-if(CAPSIMAGE_FOUND)
-  message( "  - capsimage :\tv${CAPSIMAGE_VERSION} found, allow to use .IPF, .RAW and .CTR disk images" )
-else()
-  message( "  - capsimage :\tv${CAPSIMAGE_VERSION} not found, install it to use .IPF, .RAW and .CTR disk images" )
-endif(CAPSIMAGE_FOUND)
+if(ENABLE_CAPSIMAGE)
+  if(CAPSIMAGE_FOUND)
+  else()
+    message( "  - capsimage :\tv${CAPSIMAGE_VERSION} not found, install it to use .IPF, .RAW and .CTR disk images" )
+  endif(CAPSIMAGE_FOUND)
+endif(ENABLE_CAPSIMAGE)
 
 if(UDEV_FOUND)
   message( "  - udev :\tfound, required for media change detection in NatFeats SCSI" )
